package demo2;


public class Test {
    public static void testEat(Animal animal) {
        animal.eat();
    }

    public static void testSwim(ISWIM iswim) {
        iswim.swim();
    }

    public static void testRun(IRUN irun) {
        irun.run();
    }

    public static void testFly(IFLY ifly) {
        ifly.fly();
    }

    public static void main(String[] args) {
        Dog dog = new Dog("吕布");
        testEat(dog);
        testRun(dog);
        testSwim(dog);

        Duck duck = new Duck("唐老鸭");
        testEat(duck);
        testRun(duck);
        testSwim(duck);
        testFly(duck);

        Bird bird = new Bird("大鹏");
        testEat(bird);
        testRun(bird);
        testFly(bird);

    }
}
